package com.changgou.search.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.changgou.search.service.SkuService;

/**
 * 搜索控制器
 *
 * @author gaofeng
 * @date 2025年04月23日 17:19
 */
@RestController
@RequestMapping(value = "/search")
public class SkuController {
    @Resource
    private SkuService skuService;

    /**
     * 根据条件查询
     *
     * @param searchParams 搜索条件
     * @return 搜索结果
     */
    @PostMapping(value = "/queryByParam")
    public Map<String, Object> queryByMap(@RequestParam(required = false) Map<String, String> searchParams) {
        return skuService.query(searchParams);
    }
}
